<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_bidding.*" %>
<%@page import="java.util.*" %>
<%@page import="com.lmpop.trade.ts_area.*" %>
<%@page import="com.lmpop.trade.ts_category.*" %>
<html>
  <head>
    
    <title>招标管理</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ts_areaInfo.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ts_categoryInfo.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/engine.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/util.js'></script>
	<script type="text/javascript" src="/program/plugins/calendar/WdatePicker.js"></script>
	<script language="javascript" type="text/javascript" src="bidding.js"></script>		
</head>

<body>

  <% 
 	Ts_categoryInfo classBean = new Ts_categoryInfo();
	Ts_areaInfo areaBean = new Ts_areaInfo(); 
  	String bid_id="";
  	if(request.getParameter("bid_id")!=null) bid_id = request.getParameter("bid_id");
  	Ti_biddingInfo ti_biddingInfo = new Ti_biddingInfo();
  	List list = ti_biddingInfo.getListByPk(bid_id);
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
  	String cust_id="",state_code="",title="",cat_attr="",area_attr="",start_date="",end_date="",bid_amount="",content="",contact="",phone="",cellphone="",email="",qq="",msn="",in_date="",user_id="",remark="";
  	if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
  	if(map.get("state_code")!=null) state_code = map.get("state_code").toString();
  	if(map.get("title")!=null) title = map.get("title").toString();
  	if(map.get("cat_attr")!=null) cat_attr = map.get("cat_attr").toString();
  	if(map.get("area_attr")!=null) area_attr = map.get("area_attr").toString();
  	if(map.get("start_date")!=null) start_date = map.get("start_date").toString();
if(start_date.length()>10)start_date=start_date.substring(0,10);
  	if(map.get("end_date")!=null) end_date = map.get("end_date").toString();
if(end_date.length()>10)end_date=end_date.substring(0,10);
  	if(map.get("bid_amount")!=null) bid_amount = map.get("bid_amount").toString();
  	if(map.get("content")!=null) content = map.get("content").toString();
  	if(map.get("contact")!=null) contact = map.get("contact").toString();
  	if(map.get("phone")!=null) phone = map.get("phone").toString();
  	if(map.get("cellphone")!=null) cellphone = map.get("cellphone").toString();
  	if(map.get("email")!=null) email = map.get("email").toString();
  	if(map.get("qq")!=null) qq = map.get("qq").toString();
  	if(map.get("msn")!=null) msn = map.get("msn").toString();
  	if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
  	if(map.get("user_id")!=null) user_id = map.get("user_id").toString();
  	if(map.get("remark")!=null) remark = map.get("remark").toString();

		String areaAttr = "",classAttr = "";
			
		if (map.get("area_attr") != null) {
		area_attr = map.get("area_attr").toString();
		String areaArr[] = area_attr.split("\\|");
		for( int k = 0; k < areaArr.length; k++ ){
			areaAttr = areaAttr + " &nbsp; " + areaBean.getAreaNameById( areaArr[k]);
		}
	}
	if (map.get("cat_attr") != null) {
		cat_attr = map.get("cat_attr").toString();
		String classArr[] = cat_attr.split("\\|");
		for( int i = 0; i < classArr.length; i++ ){
			classAttr = classAttr + " &nbsp; " + classBean.getCatNameById( classArr[i]);
		}
	}
	
  %>
	
	<h1>修改招标信息</h1>
	
	<!--
	<table width="100%" align="center" cellpadding="0" cellspacing="0" class="dl_so">
        <tr>
          <td width="9%" align="center"><img src="/program/admin/index/images/ban_01.gif" /></td>
          <td width="91%" align="left">
		  <h4>-----------------</h4>
		  <span>1----------------。</span><br/>
		  <span>2----------------。</span>
		  </td>
        </tr>
      </table>
      <br/>
	  -->
	
	
	<form action="/doTradeReg.do" method="post" name="addForm">
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		
			<tr>
				<td colspan="4">
			   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">招标基本信息</span>			</td>
		    </tr>		
			
		<tr>
			<td align="right" width="10%">
				标题<font color="red">*</font>
			</td>
			<td colspan="3"><input name="title" id="title" value="<%=title%>" type="text" size="40" maxlength="50"/></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				所属行业<font color="red">*</font>
			</td>
			<td align="left" colspan="3">
				<div id="classId1" style="display:block;">
								<font color="#CECECE"><%=classAttr%></font>
			<label id="name0"></label><label id="name1"></label>
			<label id="name2"></label><label id="name3"></label>
						
			<input type="hidden" name="flag_code" id="flag_code" value="0"/>
			<input type="hidden" name="class_attr_bak" id="class_attr_bak" value="<%=cat_attr%>"/>								
							<input type="button" name="buttons" value="重新选择" style="cursor:pointer;" class="buttoncss" onClick="ChangeClassStyle();" />
				</div>
				<div id="classId2" style="display:none;">
					
								  <select name="sort1" id="sort1"  onChange="setSecondClass(this.value);">
	                			
	                					<option value="">请选择</option>
	                </select>
							
										<select name="sort2" id="sort2"  onChange="setTherdClass(this.value);">
											<option value="">请选择</option>
										</select>								
						
										<select name="sort3" id="sort3">
													<option value="">请选择</option>
										</select>							  
								
				<input type="hidden" name="cat_attr" id="cat_attr" value="" />
				   
				  </div>
			</td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				所在区域<font color="red">*</font>
			</td>
			<td colspan="3">
				<div id="org1">
					<font color="#CECECE"><%=areaAttr%></font>
					<input type="button" name="buttons" value="修改地区" class="buttoncss" onclick="ChangeOrg()" />
				</div>
				<div style="display:none;" id="org2">
					<select name="province" id="province" onclick="setCitys(this.value)">
					  <option value="">省份</option> 
					</select>
					<select name="eparchy_code" id="eparchy_code" onclick="setAreas(this.value)">
					  <option value="">地级市</option> 
					 </select>
					<select name="city_code" id="city_code" style="display:inline" >
					 <option value="">市、县级市、县</option> 
					</select>
				</div>
					<input type="hidden" name="area_attr_bak" id="area_attr_bak" value="<%=area_attr%>" />
					<input type="hidden" name="area_attr" id="area_attr" value="" />
				</td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				递交标书时间<font color="red">*</font>
			</td>
			<td><input name="start_date" id="start_date"  size="15" type="text" onclick="WdatePicker({maxDate:'#F{$dp.$D(\'end_date\',{d:1})}',readOnly:true})" style="width:145px" class="Wdate" maxlength="15" value="<%=start_date%>" /></td>			

			<td align="right" width="10%">
				投标截止时间<font color="red">*</font>
			</td>
			<td><input name="end_date" id="end_date"  size="15" type="text" onclick="WdatePicker({minDate:'#F{$dp.$D(\'start_date\',{d:1})}',readOnly:true})"style="width:145px" class="Wdate" maxlength="15" value="<%=end_date%>" /></td>	
		</tr>
		
		<tr>
			<td align="right" width="10%">
				标额<font color="red">*</font>
			</td>
			<td colspan="3"><input name="bid_amount" id="bid_amount" onKeyUp="if(isNaN(value))this.value=''"  value="<%=bid_amount%>" type="text" maxlength="20"/>&nbsp;元</td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				招标内容<font color="red">*</font>
			</td>
			<td colspan="3"><textarea name="content" id="content" ><%=content%></textarea></td>
			
			<script type="text/javascript" src="/program/plugins/ckeditor/ckeditor.js"></script>
			<script type="text/javascript">
				CKEDITOR.replace('content');
			</script>			
		</tr>
		
			<tr>
				<td colspan="4">
			   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">联系人信息</span>			</td>
		    </tr>				
		<tr>
			<td align="right" width="10%">
				联系人<font color="red">*</font>
			</td>
			<td><input name="contact" id="contact" value="<%=contact%>" type="text" maxlength="20"/></td>

			<td align="right" width="10%">
				电话<font color="red">*</font>
			</td>
			<td><input name="phone" id="phone" value="<%=phone%>" type="text" maxlength="20"/>&nbsp;<font color="#666666">固话手机至少填写一个</font></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				手机:
			</td>
			<td><input name="cellphone" id="cellphone" value="<%=cellphone%>" type="text" maxlength="20"/></td>

			<td align="right" width="10%">
				E-Mail:
			</td>
			<td><input name="email" id="email" value="<%=email%>" type="text" maxlength="50"/></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				QQ:
			</td>
			<td><input name="qq" id="qq" value="<%=qq%>"  type="text" maxlength="20"/></td>

			<td align="right" width="10%">
				MSN:
			</td>
			<td><input name="msn" id="msn" value="<%=msn%>"  type="text" maxlength="20"/></td>
		</tr>

		<tr>
			<td align="right" width="10%">
				备注:
			</td>
			<td colspan="3"><input name="remark" id="remark" value="<%=remark%>"  type="text" maxlength="50"/></td>
		</tr>
		
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="2598" />
	  			<input type="hidden" name="bid_id" value="<%=bid_id %>" />
				<input name="state_code" id="state_code" type="hidden" value="<%=state_code%>"/>
				<input type="button" class="buttoncss" name="tradeSub" value="提交" onclick="submitForm();"/>&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
